package com.lunago.agent.pojo.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.FromStringDeserializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;

@Document(collection = "chat_record")
@Data
public class ChatRecord {
    @JsonIgnore
    private String _id;
    @JsonSerialize(using = ToStringSerializer.class)  // 序列化为 String
    @JsonDeserialize(using = FromStringDeserializer.class)  // 反序列化时转换为 Long
    private Long userId;
    private String content;
    private String owner;
    private Long createdAt;
}
